# -*- coding: utf-8 -*-
import itertools
def baseset(n):
    d = {}
    for x in range(2,n ):
        lend = len(d)
        d[lend] = [1] * x
    return d

def rangn(n):
    listn = range(1,n)
    return listn

def zuhe(n):
    num = n
    count = 1
    dbase = baseset(num)
    for x in dbase:
##        print u"形式:",dbase[x], u"长度:",len(dbase[x])
        lena = len(dbase[x])
        listn = rangn(num - x)
        for x in itertools.combinations_with_replacement(listn,lena):
            if sum(x) == num:
##                print x
                count += 1
    print n,u"合计:",count


##牛人写的！！！
def test():
    ways = [0] * 101
    ways[0] = 1

    for i in range (1,100):
        for j in range(i, 101):
            ways[j] = ways[j] + ways[j - i]

    print(ways[100])

def main():
    for x in range(2,3):
        zuhe(x)
if __name__ == '__main__':
    main()
    test()

